<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<c:set value="${requestScope.status}" var="status" />
<c:set value="${requestScope.codeStatus }" var="codeStatus" />
<c:set value="${requestScope.response }" var="account" />

<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<%@ include file="/common/include/title.jsp"%>
		<title>${status} - 用户中心</title>
		<style type="text/css">
			.sdfs{width: 980px;height: 400px;margin: 120px auto;}
			h1{margin-left: 100px;}
		</style>
	</head>
	<body>
		<div class="sdfs">
			<h1>${status}</h1>
			<form action="${rootPath}/forgetPassSubmit.htm" method="post" class="form form-horizontal" id="demoform-1">
					<c:if test="${fn:containsIgnoreCase(status,'解冻账号')}">
						<input type="hidden" name="status" value="ThawAccount">
					</c:if>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">邮箱账号：</label>
						<div class="formControls col-xs-5 col-sm-4">
							<input type="text" class="input-text" id="email" name="email" autocomplete="off" placeholder="请您输入邮箱账号">
							<button class="btn btn-primary radius mt-10" type="button" id="subbtn" >获取验证码</button>
						</div>
					</div>
					
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">验证码：</label>
						<div class="formControls col-xs-5 col-sm-4">
							<input type="text" name="code" id="code" value="" class="input-text" autocomplete="off" placeholder="验证码">
						</div>
					</div>
					<div class="row cl">
						<div style="margin-left: 251px;">
							<input class="btn btn-primary radius mt-20" type="submit" style="width: 350px;font-size: 16px;height: 40px;" value="提交">
						</div>
					</div>
				</form>
		</div>
		<%@ include file="/common/include/footer.jsp"%>
	  	<script type="text/javascript">
	  	var timer =0;
	  		$(function()
			{
	  			$("#subbtn").click(function() {
	  			 timer = setInterval("CountDown()", 1000); 
	  			 $("#subbtn").attr("disabled","");
		  	        $.ajax({
		  	            url: "${rootPath }/sendEmail.htm",
		  	            data: {email:$("#email").val()},
		  	            dataType:"json",
		  	            success: function(data){
		  	            	layer.msg(data.info,{icon:1,time:3000});
		  	            }
		  	       	});
		  	    });
  	 			if(${codeStatus!=null})
				{
  	 				layer.msg("${codeStatus}",{icon:1,time:3000});
  					
				};
	  			 if(${account!=null})
	  			{
	  				layer.msg("${account}",{icon:1,time:3000});
	  				
	  			}; 
			});
	  		var maxtime = 59;
	  		function CountDown() {
	  		       if (maxtime >= 0) {
	  		         msg = "重新获取("+maxtime+"s)";
	  		         $("#subbtn").text(msg);
	  		          --maxtime;
	  		       } else{ 
	  		         clearInterval(timer);
	  		       	$("#subbtn").removeAttr("disabled");
	  		         $("#subbtn").text("重新获取");
	  		       }
	  		     } 
	  	</script>
	</body>
</html>